/* Markdown 渲染样式 */
.message-text :deep(.markdown-heading) {
  font-weight: 600;
  margin: 16px 0 8px 0;
  line-height: 1.3;
  color: var(--text-primary);
}

.message-text :deep(.markdown-h1) { font-size: 24px; border-bottom: 2px solid var(--border-medium); padding-bottom: 8px; }
.message-text :deep(.markdown-h2) { font-size: 20px; border-bottom: 1px solid var(--border-light); padding-bottom: 6px; }
.message-text :deep(.markdown-h3) { font-size: 18px; }
.message-text :deep(.markdown-h4) { font-size: 16px; }
.message-text :deep(.markdown-h5) { font-size: 15px; }
.message-text :deep(.markdown-h6) { font-size: 14px; }

.message-text :deep(.markdown-paragraph) { margin: 8px 0; line-height: 1.6; }
.message-text :deep(.markdown-strong) { font-weight: 600; color: var(--text-primary); }
.message-text :deep(.markdown-em) { font-style: italic; color: var(--text-secondary); }
.message-text :deep(.markdown-del) { text-decoration: line-through; color: var(--text-tertiary); }

.message-text :deep(.markdown-inline-code) {
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  color: var(--primary-700);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.message-text :deep(.markdown-code-block) {
  background: var(--gray-50);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.message-text :deep(.markdown-code-block code) {
  background: transparent;
  border: none;
  padding: 0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  box-shadow: none;
}

.message-text :deep(.markdown-blockquote) {
  border-left: 4px solid var(--primary-500);
  background: var(--gray-50);
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.message-text :deep(.markdown-unordered-list),
.message-text :deep(.markdown-ordered-list) {
  margin: 8px 0;
  padding-left: 20px;
}

.message-text :deep(.markdown-list-item) { margin: 4px 0; line-height: 1.5; }

.message-text :deep(.markdown-link) {
  color: var(--primary-600);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.message-text :deep(.markdown-link:hover) {
  color: var(--primary-700);
  border-bottom-color: var(--primary-700);
}

.message-text :deep(.markdown-table-wrapper) { overflow-x: auto; margin: 12px 0; border-radius: 8px; box-shadow: var(--shadow-sm); }
.message-text :deep(.markdown-table) { width: 100%; border-collapse: collapse; background: var(--bg-elevated); border-radius: 8px; overflow: hidden; }
.message-text :deep(.markdown-table th) { background: var(--gray-100); padding: 12px 16px; text-align: left; font-weight: 600; color: var(--text-primary); border-bottom: 2px solid var(--border-medium); }
.message-text :deep(.markdown-table td) { padding: 12px 16px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
.message-text :deep(.markdown-table tr:last-child td) { border-bottom: none; }
.message-text :deep(.markdown-table tr:nth-child(even)) { background: var(--gray-50); }

.message-text :deep(.markdown-hr) { border: none; height: 2px; background: linear-gradient(90deg, transparent, var(--border-medium), transparent); margin: 20px 0; }

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .ai-message { background: var(--bg-elevated); border-color: var(--border-light); }
  .message-text :deep(code) { background: var(--gray-800); color: var(--primary-300); border-color: var(--border-medium); }
  .message-text :deep(.markdown-inline-code) { background: var(--gray-800); color: var(--primary-300); border-color: var(--border-medium); }
  .message-text :deep(.markdown-code-block) { background: var(--gray-900); border-color: var(--border-medium); }
  .message-text :deep(.markdown-code-block code) { color: var(--text-primary); }
  .message-text :deep(.markdown-blockquote) { background: var(--gray-800); border-left-color: var(--primary-400); color: var(--text-secondary); }
  .message-text :deep(.markdown-table) { background: var(--bg-elevated); }
  .message-text :deep(.markdown-table th) { background: var(--gray-800); color: var(--text-primary); border-bottom-color: var(--border-medium); }
  .message-text :deep(.markdown-table td) { color: var(--text-secondary); border-bottom-color: var(--border-light); }
  .message-text :deep(.markdown-table tr:nth-child(even)) { background: var(--gray-800); }
  .message-text :deep(.markdown-hr) { background: linear-gradient(90deg, transparent, var(--border-medium), transparent); }
  .message-actions { border-color: var(--border-light); }
}

